from sympy import symbols,diff,cos,sin,solve
a, x = symbols("a x")
y = x ** 2
f = diff(y,x)
print(f"f的导数为:{f}")
result = solve(f,x)[0]
print(f"f(导数)为0时x的值:{result}")
result2 = y.subs(x,result)
print(f"x为0时，y的值为:{result2}")